import { defineComponent, PropType, ref } from 'vue';
import s from "./Icon.module.scss"
export type IcomName = 'add' | 'nav' | "exports" | "clocks" | "charts" | "left" | "date"
export const Icon = defineComponent({
    props: {
        name: {
            required: true,
            type: String as PropType<IcomName>,

        },
        onClick: {
            type: Function as PropType<(e: MouseEvent) => void>
        }
    },
    setup(props, context) {
        props.name
        return () => (
            <svg class={s.icon} onClick={props.onClick}>
                <use xlinkHref={'#' + props.name}></use>
            </svg>
        );
    }
})